<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	
    protected function _initAutoload(){
        $moduleLoader = new Zend_Application_Module_Autoloader(array(
	        'namespace' => '',
	        'basePath' => APPLICATION_PATH));
        return $moduleLoader;
    }
    protected function _initViewHelpers(){
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view 	= $layout->getView();
        $view->headMeta()
        		->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8')
        		->appendHttpEquiv('X-UA-Compatible', 'IE=EmulateIE9')
        		->appendName('keywords', '游戏数据库')
       			->appendName('description', 'ARPG游戏数据库 DB.ARPGGame.com 为玩家提供详细的游戏内数据查询及ARPG游戏网站内部调用装备、技能等数据。');

        $view->headTitle()->setSeparator(' - ');
        $view->headTitle('ARPG·游戏数据库');
        
        $view->headLink()
        		->appendStylesheet('/static/css/common.css')
        		->appendStylesheet('/static/css/jquery-ui-1.8.20.custom.css')
                ->headLink(array('rel' => 'favicon', 'href' => '/favicon.ico'), 'PREPEND');
                
		$view->headScript()
				->appendFile('/static/js/jquery-1.7.2.min.js')
        		->appendFile('/static/js/jquery-ui-1.8.20.custom.min.js')
        		->appendFile('/static/js/tooltip.js')
        		->appendFile('/static/js/superfish.js')
        		->appendFile('/static/js/jquery.bgiframe.min.js')
				->appendFile('/static/js/common.js');
    }

    protected function _initdb() {  
        //require_once 'Zend/Db.php';  
          
        $params = array (  
                'host' 		=> 'localhost',  
                'username'  => 'root',  
                'password'  => '',  
                'dbname'	=> 'arpggame_db',
        );  
          
        $db = Zend_Db::factory ( 'PDO_MYSQL', $params );  
        $db->query('SET NAMES UTF8');
        // 为所有的Zend_Db_Table对象设定默认的adapter  
        //require_once 'Zend/Db/Table.php';  
        Zend_Db_Table::setDefaultAdapter ( $db );  
    }  

}

